package com.example.agron.user;

import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.LocalDate;
import java.time.Month;
import java.util.List;

@Configuration
public class UserConfig {

    @Bean
    CommandLineRunner commandLineRunner(UserRepository repository){
        return  args -> {
            /*User lisan = new User(
                   1L,
                   "lisan",
                   "lisan",
                   "lisan@gmai.com",
                   LocalDate.of(2021, Month.JANUARY, 5),
                   21
            );
            User lisi = new User(
                    1L,
                    "lisi",
                    "lisi",
                    "lisi@gmai.com",
                    LocalDate.of(2021, Month.JANUARY, 5),
                    21
            );*/
            /*repository.saveAll(
                    List.of(lisan, lisi)
            );*/
        };
    }
}
